<?php

function smarty_block_correlation($params, $content, &$smarty){
   	$row = $params['row'];
   	$asid = $_GET['asid'];
  	$oneself = M('ask')->query("SELECT * FROM hd_ask WHERE asid=".$asid);

  	$oneself = current($oneself);
  	$cid = $oneself['cid'];
	$sql = "select * from hd_ask where cid={$cid} AND asid!={$asid} order by asid limit {$row}";
	$data = M('ask')->query($sql);
	foreach($data as $v){
	$c = $content;
	foreach($v as $m=>$n){
	$c=str_replace("[\$field.$m]",$n,$c);
	}
	$str.=$c;
	}
return $str;

}

/* vim: set expandtab: */

?>
